<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title><spring:message code="system.tipsadmin"/></title>
	<%@ include file="../../../layout/admin_header.jsp"%>
	<script src="../../js/category.js"></script>
</head>
<body>
    <div id="wrapper">
        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header"><spring:message code="user.titleForm"/></h1>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                           <spring:message code="system.table"/>
                        </div>
                        <form role="form" action="create" method="post">
                        	<button type="submit" class="btn btn-default"><spring:message code="system.create"/></button>
                        </form>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                        <tr>
                                            <th><spring:message code="user.fullname"/></th>
                                            <th><spring:message code="user.gender"/></th>
                                            <th><spring:message code="user.username"/></th>
                                            <th><spring:message code="system.action"/></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    	<c:forEach var="user" items="${users}">
	                                      <tr class="odd gradeX">
	                                      		<td>${user.getFullname()}</td>
	                                      		<td>${user.getGenderName()}</td>
	                                            <td>${user.getUsername()}</td>
	                                            <td>
	                                            	<form role="form" action="edit" method="post" style="display:inline-block">
	                                            		<button type="submit" class="btn btn-default"><spring:message code="system.edit"/></button>
	                                            		<input type="hidden" name="userid" value="${user.getId()}"/>
	                                            	</form>
	                                            	<form role="form" action="delete" method="post" style="display:inline-block">
	                                            		<button type="submit" class="btn btn-default"><spring:message code="system.delete"/></button>
	                                            		<input type="hidden" name="userid" value="${user.getId()}"/>	                                            		
	                                            	</form>
	                                            </td>
	                                        </tr>
                                    	</c:forEach>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
